import React, { Component } from "react";
import styles from "./index.less";
class Page extends Component {
  state = {
    userInfo: {},
    list: [],
    saoma: false,
    decodedText: "",
    decodedResult: ""
  };
  componentDidMount() {
    let userInfo = window.localStorage.getItem("userInfo");
    this.setState({
      userInfo: JSON.parse(window.localStorage.getItem("userInfo"))
    });
  }

  render() {
    const { text } = this.props;
    const { userInfo, list, saoma, decodedText, decodedResult } = this.state;
    return (
      <div className={'settingPage'}>
        <div className={'shop'}>
          <div>商户名称</div>
          <div>{userInfo?.shop?.name}</div>
        </div>
        <div className={'scanWrap'}>
          <div
            className={'scan1'}
            onClick={() => {
              document.cookie = "";
              window.location.href =
                window.location.href.split("#")[0] + "#/user/updateUserInfo";
            }}
          >
            修改密码
          </div>
          <div
            className={'scan'}
            onClick={() => {
              document.cookie = "";
              window.location.href =
                window.location.href.split("#")[0] + "";
            }}
          >
            退出登录
          </div>
        </div>
      </div>
    );
  }
}

export default Page;
